/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.thinkgem.jeesite.modules.bls.dao;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.thinkgem.jeesite.common.persistence.BaseDao;
import com.thinkgem.jeesite.common.persistence.BaseDaoImpl;
import com.thinkgem.jeesite.modules.bls.entity.Loan;

/**
 * 信贷分析DAO接口
 * @author edpdennis
 * @version 2013-04-19
 */
public interface LoanDao extends LoanDaoCustom, CrudRepository<Loan, Long> {

	@Modifying
	@Query("update Loan set ischeck='" + Loan.STATUS_DELETE + "' where id = ?1")
	public int deleteById(Long id);
	
	@Modifying
	@Query("update Loan set processInstanceId=?2 where id = ?1")
	public int updateProcessInstanceId(Long id,String processInstanceId);
}

/**
 * DAO自定义接口
 * @author edpdennis
 */
interface LoanDaoCustom extends BaseDao<Loan> {

}

/**
 * DAO自定义接口实现
 * @author edpdennis
 */
@Component
class LoanDaoImpl extends BaseDaoImpl<Loan> implements LoanDaoCustom {

}
